package com.lone.design.pattern.creational.abstractfactory;

/**
 * @author Lone
 * @date 2021/9/24 14:03 周五
 */
public class CoffeeStore {
    private CoffeeDessertFactory factory;
    public CoffeeStore(CoffeeDessertFactory factory) {
        this.factory = factory;
    }

    public Coffee orderCoffee() {
        Coffee coffee = factory.createCoffee();
        coffee.addMilk();
        coffee.addSugar();
        return coffee;
    }

    public Dessert orderDessert() {
        Dessert dessert = factory.createDessert();
        return dessert;
    }

}
